{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "yiRapgzcWXQw"
   },
   "source": [
    "##### Copyright 2018 Google LLC.\n",
    "\n",
    "Licensed under the Apache License, Version 2.0 (the \"License\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "6AT9joAUCbDn"
   },
   "outputs": [],
   "source": [
    "# Licensed under the Apache License, Version 2.0 (the \"License\");\n",
    "# you may not use this file except in compliance with the License.\n",
    "# You may obtain a copy of the License at\n",
    "#\n",
    "# https://www.apache.org/licenses/LICENSE-2.0\n",
    "#\n",
    "# Unless required by applicable law or agreed to in writing, software\n",
    "# distributed under the License is distributed on an \"AS IS\" BASIS,\n",
    "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n",
    "# See the License for the specific language governing permissions and\n",
    "# limitations under the License."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "cIIzyWYXKT_R"
   },
   "source": [
    "# Sufficient Input Subsets Tutorial on MNIST\n",
    "\n",
    "Sufficient Input Subsets (SIS for short) is a local explanation framework interpreting black-box functions.\n",
    "A sufficient input subset is a minimal set of input features whose observed values alone suffice for the same decision to\n",
    "be reached, even with all other input values missing. These subsets can be understood as rationales for a model's decision-making.\n",
    "See the [SIS paper](https://arxiv.org/abs/1810.03805) for more details.\n",
    "\n",
    "This notebook gives a simple example for using SIS in practice.\n",
    "In this tutorial we:\n",
    "\n",
    "* Train a CNN to classify MNIST handwritten digits\n",
    "* Apply SIS to produce explanations for the model's decisions\n",
    "* Apply SIS to misclassified digits, to understand why the model made certain misclassifications"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "9JkZisP3TJjD"
   },
   "source": [
    "We recommend running this notebook in [Colaboratory](https://colab.research.google.com).\n",
    "You can open it directly [here](https://colab.research.google.com/github/google-research/google-research/blob/master/sufficient_input_subsets/tutorials/sis_mnist_tutorial.ipynb)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "LGAhNZX0T_Ke"
   },
   "outputs": [],
   "source": [
    "# If you run this notebook in Colaboratory, you can uncomment the lines below\n",
    "# and run this cell to clone the SIS library without any further installation.\n",
    "\n",
    "# !git clone https://github.com/google-research/google-research.git\n",
    "# %cd google-research"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "rC3GlnQwKgZb"
   },
   "outputs": [],
   "source": [
    "from __future__ import print_function\n",
    "\n",
    "import tensorflow as tf\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "\n",
    "from sufficient_input_subsets import sis"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "DlMgpBIHKoap"
   },
   "source": [
    "# Download MNIST"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "IR_UIHW-Kp0b"
   },
   "outputs": [],
   "source": [
    "# Load MNIST and convert from integers to floats.\n",
    "\n",
    "mnist = tf.keras.datasets.mnist\n",
    "\n",
    "(x_train, y_train), (x_test, y_test) = mnist.load_data()\n",
    "x_train, x_test = x_train / 255.0, x_test / 255.0\n",
    "x_train = np.expand_dims(x_train, axis=-1)\n",
    "x_test = np.expand_dims(x_test, axis=-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {
     "height": 111
    },
    "colab_type": "code",
    "id": "mwlrsL1PN48u",
    "outputId": "ec31d6df-8c8f-4c5b-f2f7-4a11edc41bb8"
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAGAAAABeCAYAAADc6BHlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAACrdJREFUeJztnNtvGscegL8F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AvQt\nR5lMhsePHzM3N0csFmNycpJYLEY4HDb2gr3f4uFdTrjf77O3t8fa2hq//fYbS0tLtFotzs/PURTl\nxjJef8etFeByuYjH48Zwcn5+3uhqPB6PsWFO31Iqy7IR969UKpTLZba2toydjLu7u0YQ7jZxawW4\n3W6mpqaYnZ1lbm7O2KWot3hVVel0OsZD9fT01Ag1v3z5kvX1dZrNJs1mk06nc2ta/J+5tQIGgwFn\nZ2ccHBzgdrspl8uXPldV1dgqdHp6SqVSMeI4W1tb7OzsGMvQbzO3dpOeKIr4/X5jSOl2uy99ri/C\nHQwGxo4XeLeDRu+S9JVvZvJ3v39rBdwXrH9ZdsuxBJiMJcBkLAEmY+ow1OwRym3AugNMxhJgMpYA\nk7EEmIwlwGQsASZjCTAZS4DJWAJMxhJgMpYAk7EEmIwlwGQsASZjCTAZS4DJWAJMxhJgMpYAk7EE\nmIwlwGQsASZjCTAZS4DJWAJMxhJgMv8BFiKCe1bKZbIAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa6aea3b1d0>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Visualize an example digit.\n",
    "\n",
    "image = x_train[0]\n",
    "\n",
    "plt.figure(figsize=(1, 1))\n",
    "plt.imshow(image[:, :, 0], cmap=plt.get_cmap('gray'))\n",
    "plt.axis('off')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "ROdUa2s6KrRh"
   },
   "source": [
    "# Train an MNIST Digit Classifier"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "BRraBRCQb5Bs"
   },
   "source": [
    "We train a simple convolutional neural network (CNN) (taken from the Keras MNIST CNN\n",
    "[example](https://github.com/keras-team/keras/blob/master/examples/mnist_cnn.py)) to classify MNIST\n",
    "handwritten digits"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "ruzDwAK7Ktcr"
   },
   "outputs": [],
   "source": [
    "model = tf.keras.models.Sequential([\n",
    "    tf.keras.layers.Conv2D(32, kernel_size=(3, 3), activation='relu',\n",
    "                           input_shape=(28, 28, 1),\n",
    "                           data_format='channels_last'),\n",
    "    tf.keras.layers.Conv2D(64, kernel_size=(3, 3), activation='relu'),\n",
    "    tf.keras.layers.MaxPooling2D(pool_size=(2, 2)),\n",
    "    tf.keras.layers.Dropout(0.25),\n",
    "    tf.keras.layers.Flatten(),\n",
    "    tf.keras.layers.Dense(128, activation='relu'),\n",
    "    tf.keras.layers.Dropout(0.5),\n",
    "    tf.keras.layers.Dense(10, activation='softmax')\n",
    "])\n",
    "\n",
    "model.compile(optimizer='adam',\n",
    "              loss='sparse_categorical_crossentropy',\n",
    "              metrics=['accuracy'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "colab": {
     "height": 225
    },
    "colab_type": "code",
    "id": "Dn3OPA8tNuTk",
    "outputId": "2ccd96be-7ad3-498a-efe5-96bd2bbbca6c"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Epoch 1/5\n",
      "60000/60000 [==============================] - 7s 110us/step - loss: 0.1847 - acc: 0.9445\n",
      "Epoch 2/5\n",
      "60000/60000 [==============================] - 7s 110us/step - loss: 0.0796 - acc: 0.9763\n",
      "Epoch 3/5\n",
      "60000/60000 [==============================] - 7s 115us/step - loss: 0.0586 - acc: 0.9822\n",
      "Epoch 4/5\n",
      "60000/60000 [==============================] - 7s 120us/step - loss: 0.0499 - acc: 0.9842\n",
      "Epoch 5/5\n",
      "60000/60000 [==============================] - 7s 116us/step - loss: 0.0405 - acc: 0.9876\n",
      "10000/10000 [==============================] - 0s 41us/step - loss: 0.0312 - acc: 0.9909\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[0.031191634417892054, 0.99089998]"
      ]
     },
     "execution_count": 0,
     "metadata": {
      "tags": []
     },
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Train and evaluate model.\n",
    "\n",
    "model.fit(x_train, y_train, epochs=5)\n",
    "\n",
    "model.evaluate(x_test, y_test)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "09M0TQMmKv8o"
   },
   "source": [
    "# Run SIS to Produce Explanations"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "tEi4UOY3qpnd"
   },
   "source": [
    "We now apply SIS to understand the model's decisions on particular examples of digit 4. First, we will find images from the test set which the model classifies as 4 with high confidence. Then, we will compute and visualize the SIS-collection for some of these images.\n",
    "\n",
    "By default, we follow the SIS paper and use a threshold of 0.7 ($\\tau = 0.7$) and mask pixels by\n",
    "replacement with the mean pixel taken over the training images.\n",
    "\n",
    "Feel free to explore different values of these parameters and observe the effects on the SIS!\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "cellView": "both",
    "colab": {
     "height": 481
    },
    "colab_type": "code",
    "id": "AP1d9dDF8zIj",
    "outputId": "48d94117-305d-48aa-eda3-029099cd52d7"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Running SIS on 5 examples of digit 4. This might take a couple minutes.\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAABZCAYAAADFEWQMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAD1pJREFUeJzt3clvW1UbBvDnXjueHdup7SSNMw+lbdIoTVBLB1QGoVYR\nSEDFsGABa3bwByBgBRsEbFgAEpVAQAUqSBVCQqJ0IIFItI3TNGnaOE1sJ2kSO56na38L5MsXQmlK\nm7o+fn4Sm9hXPQfbj4/PPec9UqFQKICIiIQil7oBRER09zHciYgExHAnIhIQw52ISEAMdyIiATHc\niYgExHAnIhIQw52ISEAMdyIiAWlL+Y9LklTKf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/H6lUqkQ9ISLaHGUZ7oqibKjoUvG8yerqavWcVOCvm67x\neHzDVfmIiMpJWYb7RsmyrJYqaGxs5MHCRFQxhDhD9WYkSVID3mg0qmvdi38zmUwwmUw3PW+ViKhc\nCR3uN1MsOVBdXQ2bzcZiTkQkHKHDXVEUZDIZLC8vw+fzYXV1FcCfK25yuRySySSSySRXyhCRcIQP\n93Q6jfn5eUxOTiIUCql/z2Qy6m7USqqvTUSVQehwLxQKavW1YoXH/3+MG5aISFRChzsAdV17KpXi\n9AsRVQzhwx34c9NTOBxWNytpNBro9XreUCUiYVVEuCcSCbXCY5FGo4HJZFKL5xMRiaQiwn1paQkT\nExMIhUJQFAUrKyuYm5vD4uIiVldXeSA2EQmnIoasy8vLuHLlCq5du4aZmRnMzMxgfHwcwWCQ5QeI\nSEhSoYTLRf5+/uBmMRqNsFgs6OzshMfjQSwWw/LyMq5du7aubPCdqsTVN/fqdbxX/v4aitY/QPw+\nit4/4NZZUxHhfi8x3MtfJQaDaH0UvX/ArbOmIubciYgqDcOdiEhAJZ2WISKizcGROxGRgBjuREQC\nYrgTEQmI4U5EJCCGOxGRgBjuREQCYrgTEQmI4U5EJCCGOxGRgBjuREQCYrgTEQmI4U5EJCCGOxGR\ngBjuREQCYrgTEQmI4U5EJCCGOxGRgBjuREQCYrgTEQmI4U5EJCCGOxGRgBjuREQCYrgTEQmI4U5E\nJCCGOxGRgBjuREQC+h9CBZU5jlHUvQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa60faa2c50>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAQcAAABaCAYAAAC1zJM6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAD5lJREFUeJzt3UtQm2X7x/Fv8pCQBBIaEhJOLVBoWiinAqVQ3kod7WjH\ndkadOo66cRwXXbpy6cKVK8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YGCA\nBw8eMD09zdTUFBMTEwwPD+N2u+M9EPBw1DE9PY3f76enp4cbN27EJyxDoVCSv5kQD3m9Xrxeb7LL\n+Iu0CIcVsViMQCDA5OQkp06dwul0xicXFxcXWVhYIBKJUF9fz/PPP8/27dvR6/UMDQ1x/fp1+vv7\nmZyclLkFIVYhLcJhaWkJj8dDR0cHbreb+fl5rly5gtvtjgcDPFzqcTgcNDQ00Nrais1mY3Jyku7u\nbn7++WeGhoakj0GklPLycurr6xkaGqKrqyulGvHSIhxWXjLj8XhYWlpicXExPgn551FAYWEhL7zw\nAv/5z39oamoiHA4zPDzMtWvXOHPmTFqdRizWh6amJj788EOOHTtGT0+PhMOTWl5eJhgMMjc3RywW\ni7/0Y6WJIzs7G7vdzo4dO2hubqaiogKdTsft27f57bff6O3tZXp6el02KInUNjIyEt9UlUrBAGkS\nDgCLi4t/+0iQk5NDTU0NO3fupKGhAYvFQjQaxe12c/LkyfiIQ4hUs/ICpWg0mnJzYWkTDolkZWVR\nVFREVVUVu3btwuFwoNfr8Xg89PX1cfXqVTwej+y6FClny5Yt7N69m/v373Pp0qWUPEY/rd9bkZ2d\nTWVlJbt27aKlpYWKigo0Gg0DAwMcP36cK1eu4PP50urAUbE+bNu2jcOHD7N///54+3+qSauNV4/K\nysqisLAw/mM0GtFoNDx48IDbt28zMTHxzI8pX4/zGqn0roV/y9PeeFVRUUFra2v8nSrJ6M593L2a\n1uGQiiQc1oZk7sp8Vh53r6b1Y4UQ4umRcBBCJCThIIRISMJBCJGQhIMQIiEJByFEQkldyhRCpC4Z\nOQghEpJwEEIkJOEghEhIwkEIkZCEgxAiIQkHIURCEg5CiIQkHIQQCUk4CCESknAQQiQk4SCESEjC\nQQiRkISDECIhCQchREISDkKIhCQchBAJSTgIIRKScBBCJCThIIRISMJBCJGQhIMQIiEJByFEQhIO\nQoiEJByEEAlJOAghEpJwEEIk9H9pGlr1PXhuowAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa60fabb650>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAh4AAABZCAYAAABxAS23AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEyFJREFUeJzt3VlsVOf5BvDnLDNnzqweM4ttDN7jOsYlBmMlUkhEaKBA\nF6lN1N4kjdq79q7iqhe9oFVuEkVVFBFFSqQkjVSyXKQXWEBLJJqEiNauCYsB433B4Bl7PJ7NZxb7\nf4Fm8jc0isHH53hmnt8dCM683wz4PPOd73s/YWVlZQVEREREBhDNLoCIiIjKB4MHERERGYbBg4iI\niAzD4EFERESGYfAgIiIiwzB4EBERkWEYPIiIiMgwDB5ERERkGAYPIiIiMgyDBxERERlGNvPFBUEw\n8+V1V47d50v9Myy18QGlP0aOr/iV+hjLbXz34owHERERGYbBg4iIiAzD4EFERESGYfAgIiIiwzB4\nEBERkWEYPIiIiMgwpm6n3UxEUYQkSVBVFaIoIp1OI5PJIJvNluU2WSKzSJIEu90OQRCQTCaRzWbN\nLomIdMTggbuhw+12o66uDgcOHIDX68V///tfXLt2DSMjI0ilUmaXSFQ2AoEAnnvuOdjtdnzyyScY\nHh42uyQi0lFRBQ9RFGGxWGCxWCDLMjKZDFKpFJaXl9d1XUmSEAgE0NHRgZ/+9KcIBoOQZRmxWAxT\nU1MMHkXEarXC5/NBFEWEw2EsLS2ZXRKtkSAIcDqdqK2tRWdnJ2w2G86cOWNaPbIsw2azIZfLYWlp\niTOfRDopquBhs9lQU1ODQCCALVu2YGZmBgMDA1haWlpX+LBYLGhtbcWePXuwZcsWrKys8IdMkQoE\nAnjxxRfhdDrx3nvv4caNG2aXRGukKAo6OzvR1NSEU6dOYWZmBuPj46bV4/V68cgjjyASiWBwcJCP\nfIh0UlSLS51OJ5qbm7Fnzx7s27cP3//+9+HxeGC1Wtd1XVmWsW3bNnzve9+D2+0GAIaPIuV0OvH4\n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MWv1MdYbuO7V9ktLiUiIiLzMHgQERGRYRg8iIiIyDAMHkRERGQYUxeXEhER\nUXnhjAcREREZhsGDiIiIDMPgQURERIZh8CAiIiLDMHgQERGRYRg8iIiIyDAMHkRERGQYBg8iIiIy\nDIMHERERGYbBg4iIiAzD4EFERESGYfAgIiIiwzB4EBERkWEYPIiIiMgwDB5ERERkGAYPIiIiMgyD\nBxERERmGwYOIiIgMw+BBREREhmHwICIiIsMweBAREZFhGDyIiIjIMAweREREZBgGDyIiIjIMgwcR\nEREZhsGDiIiIDPN/AB/J2JaM3TkAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa60f069310>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAa8AAABZCAYAAACJ16uxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEJhJREFUeJzt3dlPXOUfBvDnzM6sDDNDobRQCkxSaEsJxXSxLj+1JrRq\nWqMxLklvvDDxSusf4I032t5pYkyMxgs1jcSYSu1miKVEsLEbUKFgp8MydIYZmIVh9vldmJl0w4IF\nTt+Z55NwUcphvocD55nznvf9HimbzWZBREQkEIXcBRARES0Vw4uIiITD8CIiIuEwvIiISDgMLyIi\nEg7Di4iIhMPwIiIi4TC8iIhIOAwvIiISjkrOF5ckSc6XXxHF1rCkGI5hoe1joe8fUPj7WOj7Bzz4\nXMorLyIiEg7Di4iIhMPwIiIi4TC8iIhIOAwvIiISDsOLiIiEw/AiIiLhMLyIiEg4si5SXi4KhQJK\npRIAkMlkkMlk/nWBmyRJUCqVUKlUkCQJyWQS6XS66BYYE8lNkiRoNBpIkoREIoFMJiN3SUUtd27M\nZrNIp9Nyl/OvhA4vSZKgUqmwZs0aOJ1OSJIEn88Hn88Hr9d73x++UqmEw+FATU0NduzYAYPBgJ6e\nHgwNDSEQCCAej8uwJ0TFyW6344UXX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GrKiogF6vRzqdRiQSQTAYxPz8PK+8iIiWIHfP69SpU7J0\nWCmqK69chw29Xp9vyJtIJITtcEBEJJdcr1mbzSZLf8SiCi+r1YqqqioYjUa5yyEiEtrt97w2b968\n6q9fNMOGwD/vFHKdNHilRUS0dAqFAo2NjWhsbEQ2m0V/f78sjzMqmvDKZrNIpVKIx+P3dN8gIqLF\nUalUeOqpp7B37158//33OHPmjCw9HYsmvIB/1iXw/hYR0cMxGo0oLS1FNBpdcG3tSiuqy4/cwmRO\niSci+u8ehQuBogkvSZKg0WhQUlLCR58QET0EjUYDvV4v67m0aMILuP8PnEOIRESLJ0kStFpt/nEo\ncinaS5B4PA63243R0VFEIhG5yyEiEkIqlcKpU6cwPT2N+vp6HD58GL/88suqN+ctqiuv2yWTSUxM\nTMDlcsnSVJKISETpdBrd3d349ttvUV5ejtdeew21tbWrXkfRXnnlps7LfdORiEhEufZQPT09fCTK\nSspms5idncX4+DhKSkoQDAbh9/sRiUSQSqXkLo+ISCjz8/Po6uqS7fWLJrxy47Q3btyAUqlEIpHA\nzZs34fF4eM+LiEgwUlbGMbNCezQ3UHyzF4vhGBbaPhb6/gGFv4+Fvn/Ag8+lRTthg4iIxMXwIiIi\n4cg6bEhERPRf8MqLiIiEw/AiIiLhMLyIiEg4DC8iIhIOw4uIiITD8CIiIuEwvIiISDgMLyIiEg7D\ni4iIhMPwIiIi4TC8iIhIOAwvIiISDsOLiIiEw/AiIiLhMLyIiEg4DC8iIhIOw4uIiITD8CIiIuEw\nvIiISDgMLyIiEg7Di4iIhMPwIiIi4TC8iIhIOAwvIiISDsOLiIiEw/AiIiLh/B9+0QZs5G3ldAAA\nAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa60eccc510>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAABZCAYAAADFEWQMAAAABHNCSVQICAgIfAhkiA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CCEqROFOCCEqROFOCCEqROFOCCEqROFOCCEqROFOCCEqROFOCCEqROFOCCEqROFOCCEqROFO\nCCEqROFOCCEqROFOCCEqROFOCCEqROFOCCEqROFOCCEqROFOCCEqROFOCCEqROFOCCEqROFOCCEq\nROFOCCEqROFOCCEqROFOCCEqROFOCCEqROFOCCEqROFOCCEq9D9BJQDGB4MRFAAAAABJRU5ErkJg\ngg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa60e14d310>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#@title Select a digit and threshold {run: \"auto\"}\n",
    "\n",
    "DIGIT = 4  #@param ['0', 1', '2', '3', '4', '5', '6', '7', '8', '9'] {type:\"raw\"}\n",
    "\n",
    "THRESHOLD = 0.7  #@param {type:\"slider\", min:0, max:1, step:0.1}\n",
    "\n",
    "# Following the SIS paper, we use the mean pixel from training images as a mask.\n",
    "FULLY_MASKED_IMAGE = np.full((28, 28, 1), np.mean(x_train))\n",
    "\n",
    "# Helper function that selects the probability for a single class, from the\n",
    "# softmax output.\n",
    "def make_f_for_digit(digit, model):\n",
    "    def f_digit(batch_of_inputs):\n",
    "        return model.predict(\n",
    "            batch_of_inputs,\n",
    "            batch_size=min(784, len(batch_of_inputs)))[:, digit]\n",
    "    return f_digit\n",
    "\n",
    "# This function maps a list of images to a list of probabilities (probability of\n",
    "# each image being a 4).\n",
    "f_digit = make_f_for_digit(DIGIT, model)\n",
    "\n",
    "# Helper function that filters input images to those the model predicts with\n",
    "# high confidence (f(image) >= threshold).\n",
    "def select_images_for_sis(inputs, f_digit, threshold):\n",
    "    preds = f_digit(inputs)\n",
    "    idxs = np.nonzero(preds >= threshold)[0]\n",
    "    return inputs[idxs]\n",
    "\n",
    "# Filter test images that the model classifies as 4 with high confidence.\n",
    "high_confidence_images_for_digit = select_images_for_sis(x_test, f_digit,\n",
    "                                                         THRESHOLD)\n",
    "\n",
    "# Randomly select some of these digits to run SIS.\n",
    "digits_to_run_sis = high_confidence_images_for_digit[\n",
    "    np.random.choice(high_confidence_images_for_digit.shape[0],\n",
    "                     size=5,\n",
    "                     replace=False)]\n",
    "\n",
    "# Helpers for plotting an MNIST digit and its corresponding SIS-collection.\n",
    "def plot_mnist_digit(ax, image):\n",
    "    ax.imshow(image[:, :, 0], cmap=plt.get_cmap('gray'))\n",
    "    ax.axis('off')\n",
    "\n",
    "def plot_sis_collection(initial_image, collection, fully_masked_image):\n",
    "    # Grid contains initial image, an empty cell (for spacing), and collection.\n",
    "    width = len(collection) + 2\n",
    "    plt.figure(figsize=(width, 1))\n",
    "    gs = plt.GridSpec(1, width, wspace=0.1)\n",
    "\n",
    "    # Plot initial image.\n",
    "    ax = plt.subplot(gs[0])\n",
    "    plot_mnist_digit(ax, initial_image)\n",
    "\n",
    "    # Plot each SIS.\n",
    "    for i, sis_result in enumerate(collection):\n",
    "        ax = plt.subplot(gs[i+2])\n",
    "        masked_image = sis.produce_masked_inputs(\n",
    "            initial_image, fully_masked_image, [sis_result.mask])[0]\n",
    "        plot_mnist_digit(ax, masked_image)\n",
    "\n",
    "    plt.show()\n",
    "\n",
    "print('Running SIS on {} examples of digit {}. '\n",
    "      'This might take a couple minutes.'.format(len(digits_to_run_sis), DIGIT))\n",
    "\n",
    "# Run SIS on each digit and visualize the resulting SIS-collections.\n",
    "for initial_image in digits_to_run_sis:\n",
    "    collection = sis.sis_collection(f_digit, THRESHOLD, initial_image,\n",
    "                                    FULLY_MASKED_IMAGE)\n",
    "    plot_sis_collection(initial_image, collection, FULLY_MASKED_IMAGE)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "DEusIBM5qx2V"
   },
   "source": [
    "# Using SIS to Understand Misclassifications"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "tR3AXUpHLh8n"
   },
   "source": [
    "We now explore how SIS can be used to understand misclassifications.\n",
    "\n",
    "First, we will search for images from the test set (of any class) which the CNN misclassifies with high confidence. Then, we will compute and print the corresponding SIS-collections for some of these images to see the rationales to better understand why the model made these misclassifications."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 0,
   "metadata": {
    "cellView": "both",
    "colab": {
     "height": 1297
    },
    "colab_type": "code",
    "id": "WPn918BoqzY3",
    "outputId": "3af16722-d01d-4834-c1cf-9bdc40b220eb"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Running SIS on 10 misclassified digits. This might take a couple minutes.\n",
      "\n",
      "True label:     5\n",
      "Classified as:  3\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAT8AAABaCAYAAADO6FH2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADRxJREFUeJzt3d9PW/X/wPFnW/qTlsJa2gFlY0AH+wHMsR9sZhs6YzQx\nxnhhYvwHvPIPMFmyO+Ot3nhlYmJiTDQak2kyZ5a46X44YGPo6MbWFgrjZ+kvBqen7flc7Eu/zu3z\n+ejHyaE9r0fSO6DvQ9tnTs/7nPcxaZqmIYQQBmPWewBCCKEHiZ8QwpAkfkIIQ5L4CSEMSeInhDAk\niZ8QwpAkfkIIQ5L4CSEMSeInhDAkiZ8QwpBq9Hxyk8mk59P/I4x4taARXsdq28YnvU+NsI2/J3t+\nQghDkvgJIQxJ4ieEMCSJnxDCkCR+QghD0nW2dzPxeDy0tLTgdrsfmfWyWq3lR01NDZFIhGg0quNI\nhRBPg8Tv/3i9Xvbt20dTUxNms7kcQJfLhdvtxuVy4XA4+OKLLyR+QlSBqo6f3+8nGAxSU1ODxWIB\noFgskslk0DSNcDhMKBSivr6epqYm2tvbqaurw2z+/6MBVqsVm81GNptleXkZm82m1+YIIZ6iqoyf\nxWLBarXS0tJCT08PNpsNq9UKQKFQIJFIoGkaL7zwAgcPHmTbtm34fD4cDkc5kutKpRKlUom7d++S\nyWSq7kRQITaS2WzGZrOhaRr5fF7XiwKqMn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+/bt4/Tp04aK34kTJzh9+jS5XI7p6Wnef/99iZ9ONn38EokEV65cQVEUpqam6O/vJxwOY7Va\nMZvNqKpaDlw0GiUajTIxMcHt27fJZDKsrKyQSqV0uS+oeLJcLsfZs2eZm5ujv7+fnp4eVFXl3r17\n/PTTT1V9A/mhoSE+/PBD8vk86XRawqcnTUfAn3qYzWatqalJGxwc1D799FNtcXFRW11d1fL5vJZK\npbQrV65o7733nvbyyy9rXq/3T//df+JhRP/r/2rXrl3aV199pSmKoi0vL2uff/651tPTo+vr9+9e\nR73HsxHvU73HtBHb+HsVcfc2k8mEy+XC5/PR29tLe3s7Vqu1PKmxtLTE5OQkU1NTTE9PP7Z0/UbS\n8d+pm/91uX+fz8fx48fp6OhAVVWi0SiXLl3aFHt+f3wdq+2WBk96nxphG3+vIuJXSSR+1UHiV/n+\n22dRblQhhDAkiZ8QwpAkfkIIQ5L4CSEMSeInhDAkiZ8QwpB0PdVFCCH0Int+QghDkvgJIQxJ4ieE\nMCSJnxDCkCR+QghDkvgJIQxJ4ieEMCSJnxDCkCR+QghDkvgJIQxJ4ieEMCSJnxDCkCR+QghDkvgJ\nIQxJ4ieEMCSJnxDCkCR+QghDkvgJIQxJ4ieEMCSJnxDCkCR+QghDkvgJIQxJ4ieEMCSJnxDCkCR+\nQghDkvgJIQzpXw2yBzbXybOLAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa60aa4d7d0>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True label:     4\n",
      "Classified as:  6\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAQcAAABaCAYAAAC1zJM6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAD85JREFUeJzt3e1PW/X/x/FnLym9gMIK42KUTcrFYBvb6GRjm3NTF830\njt6b+g+YmKjxf/CO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iiScBBCKJJwEEIoknAQQiiS\ncBBCKJJwEEIoknAQQij6P34A0RxMDYg/AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa60d39d810>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True label:     8\n",
      "Classified as:  0\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAANAAAABaCAYAAADJj9jKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADdhJREFUeJzt3NlSG8cex/HvaNcgWQtiEQYEYTcQx4kd70nsOHepSm7y\nEnmSvEEuk6o8QG5cSaqSuLwEbGPwio0NRsggEEa7QGiXzoVLc06WYycZbJD9/1TpTmpmRvzUPT3/\nbqVWq9UQQvwrht0+ACEamQRICB0kQELoIAESQgcJkBA6SICE0EECJIQOEiAhdJAACaGDaTf/uKIo\nu/nnX5o3sbjjTf0upQcSQgcJkBA6SICE0EECJIQOEiAhdJAACaGDBEgIHXb1OZAeiqJgNBpRVRW7\n3f7c9xaLRba2tiiVSq/o6MSbomEDZDAYMJvNNDc309zc/Nz3bm5uUiqVJEBixzVMgBwOB06nE5/P\np71aWlpoa2vD6/U+97PpdJonT57w+PFjHj58SDwep1QqvZEVA2JnNUyAnE4nnZ2djI6OMjo6yuDg\nIAMDA/h8Ptxu93M/m0qlWFxc5PLly2xtbZHNZqlUKlQqlVd09OJ1tacDpCgK+/fvp7e3lwMHDjA2\nNkZHRwd+vx+fz4fX60VVVcxm83PbcTgcdHd3c+TIEcrlMlevXmVycpJEIvGKzkS8rvZsgAwGAwaD\ngZ6eHs6cOcOJEyc4fvw4VqsVi8Wiva9Wq1GtVn83HPvfwkZFUbDZbPj9fhwOB36/H5vNxtzcHMlk\nUoZxQpc9G6DOzk5GRkY4ceIEp0+fJhAIYLVaqVarbG9voygK1WqVlZUVIpEI2WyWUqlE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DidTm2y4I/3PCsrK0xOTjI5OcnU\n1JRsNPIKbG5u8v3332MwGBpiOX1DB6hWq5HP54lGo0xNTeH1ehkdHaWrqwuDwYDJ9Oz09u3bR29v\nL+3t7QBa/Zzdbtf2Sai3V6vVWFtbY3V1ld9++41Lly7x5MmTXdt37E3USPuWN3SA4Fn5TTweZ2pq\nCkVRtF17zGazVk+lqiqqqv7fNurBqVarVCoVVlZWuH79OleuXOHSpUva6lYh/qjhAwTPZsrC4TAG\ng4Farcb8/Dz79++nq6uLQCCAx+N57ufj8Thra2ssLy+zsrLCw4cPmZubY2lpSSvpEeKvvDYBikQi\nxONxIpEI9+7dY3x8nPfeew+73Y7dbv/T/U2916lUKoTDYe7cucPMzAwzMzPaAjshXuS1CFBduVwm\nlUoRDAbZ3NwkEomwvr5Ob28vTqdT21ikUqlQKpWIx+Osrq6ytram7Q23vr5OJpPZ7VMRDUKp7eLU\n0st80q8oCh6PhwMHDtDT04PP58NqtVIulykWixQKBZ48ecKDBw9IJpPa3nM7cTnexNm617Vq40Xf\n5WsbIECr1t63bx82mw2j0agN2yqVCplMhkQioW3/u1OXQgL0+nijA7RbJECvjxd9l1JeLIQOEiAh\ndJAACaGDBEgIHSRAQuggARJCh12dxhai0UkPJIQOEiAhdJAACaGDBEgIHSRAQuggARJCBwmQEDpI\ngITQQQIkhA4SICF0kAAJoYMESAgdJEBC6CABEkIHCZAQOkiAhNBBAiSEDhIgIXSQAAmhgwRICB0k\nQELoIAESQgcJkBA6SICE0EECJIQOEiAhdPgPi5ozwN5k1qMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa60b273d90>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True label:     7\n",
      "Classified as:  3\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAQcAAABaCAYAAAC1zJM6AAAABHNCSVQICAgIf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cPyWQyHB0dUSwW\nT2na59ONIerEN4Y9/Xvshm18WlvvORiGQTQaxePxkEwm2d7eJpFIvPIgCNGJ2nrPweVyEYlEcDqd\nmKZJPp8nl8vZekVC9hw6g+w5tHkcziKJQ2eQOHTB8xyEEC9H4iCEsGTrYYUQ4uySPQchhCWJgxDC\nksRBCGFJ4iCEsCRxEEJYkjgIISxJHIQQliQOQghLEgchhCWJgxDCksRBCGFJ4iCEsCRxEEJYkjgI\nISxJHIQQliQOQghLEgchhCWJgxDCksRBCGFJ4iCEsCRxEEJYkjgIISxJHIQQliQOQghLEgchhCWJ\ngxDC0v8AHb/wKTRV3Z4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa60b8a91d0>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True label:     1\n",
      "Classified as:  6\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAANAAAABaCAYAAADJj9jKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAACOlJREFUeJzt3UtPE+0bx/HfTOfQAz3SlkNLKW1BUYNE1pq4cKM7YnwN\nLozvw1fAwo1xZ0xcucLEsHBlSBQjFbAgBUpbej7PtFP6XzxpI//nIQIjDB2uT+IGknKR8k3v3nNP\nZTqdTgeEkDNhtR6AkH5GARGiAgVEiAoUECEqUECEqEABEaICBUSIChQQISpQQISowGn5wxmG0fLH\nn5ureLjjqj6X9ApEiAoUECEqUECEqKDpe6CLxLIsXC4XAoEA3G43bDYb6vU6MpkMUqkUkskkFEXR\nekxySn6/HzMzMygUCvj27RtqtdqF/vwrERDLsuB5HoFAAA8fPsSdO3cQiUSQTCaxvLyMT58+IZfL\nUUB9aHp6Gs+fP0c0GsXOzg4FdB4EQYDb7UYoFMLs7CxGRkaQyWSwt7eHQqEASZKu5M5ZP/P5fJib\nm8PU1BQ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A73bt\nRCKBra0tlMvl3hm4SqWCeDyOnZ2dU78HOjw8RCaTwY8fPyggcqy+XsJ1NZtNbGxswO12w+l0wm63\no1qtIpvNnuj+n/+XTqfx9etXbG1t4efPn8jn8+cwNdEDXQTUarUQi8XAcRwikQjcbjfy+fyZt6/T\n6TRWVlawu7uLnZ2dS70GJ9piOhouMP/WLhfDMLBYLHC5XJiensbw8DAkScLBwQFWV1dxcHBwqsfr\nnmrofpJPp9M51Tr8Mq/Zz4tedyz/9FzqIqDLhgLSjz89l32/iUCIliggQlSggAhRgQIiRAUKiBAV\nKCBCVKCACFGBAiJEBU0vpBLS7+gViBAVKCBCVKCACFGBAiJEBQqIEBUoIEJUoIAIUYECIkQFCogQ\nFSggQlSggAhRgQIiRAUKiBAVKCBCVKCACFGBAiJEBQqIEBUoIEJUoIAIUYECIkQFCogQFSggQlSg\ngAhRgQIiRAUKiBAVKCBCVPgfVMOONj0SaqwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa60dc2a1d0>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True label:     9\n",
      "Classified as:  8\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAQcAAABaCAYAAAC1zJM6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADA5JREFUeJzt3d9Pm2Ufx/H33R8UKJRSCt2gUEbHXBRwZOpwzKkzxhin\niVk0McZo9Ehn4olHJjNZjIce+QfogR56ZuISt2nGD0EHVKCjTGCwFkZpKb+hv/sc+NA87rnNnLrd\n5e73lXBI+r3uNp9e19Xr/t5KLpfLIYQQtzFoXYAQojBJOAghVEk4CCFUSTgIIVRJOAghVEk4CCFU\nSTgIIVRJOAghVEk4CCFUSTgIIVSZtHxxRVG0fPl7ohhPoxfD+1gMY7ydzByEEKokHIQQqiQchBCq\nJ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pibi\n8Xj+QTe5XC4fEEJoafcLqtCWF0pOw6/Of/tiGI1GzGYzL7/8Mu+//z5utxubzcb169eZnJwklUqx\nvr5OT08PIyMjRCKRf73hSzHORArtQ/1vuP19vFdj7Ojo4OTJkzgcDsrLy/n++++5dOnSPXmt293p\ns6qrmUM2myWdTrO8vEwgEKCsrAyXy8XRo0d59NFHSSQShMNh1tbWmJ2dZX19XbpBCU2Njo4yOjrK\n2bNnOXv2LLFY7L6Fw53oKhxyuRzZbJb5+Xn6+/vzP13W19fjdDqZmJhgaGgIn88nnaBEQdltaDM0\nNKR1KXm6Cgf4ffYQDof/cJFbW1vxeDz88ssv/Pjjj/j9fmkuKwrK7gyikOhqz2FXaWkpVqsVp9NJ\nXV0dVVVVVFRUMD8/z8LCApFI5J49ol32HPThfu05aOlOn1VdhoOWJBz0QcJBpyckhRD/nISDEEKV\npssKIUThkpmDEEKVhIMQQpWEgxBClYSDEEKVhIMQQpWEgxBClYSDEEKVhIMQQpWEgxBClYSDEEKV\nhIMQQpWEgxBClYSDEEKVhIMQQpWEgxBClYSDEEKVhIMQQpWEgxBClYSDEEKVhIMQQpWEgxBClYSD\nEEKVhIMQQpWEgxBClYSDEEKVhIMQQtV/AHzDGS42KeFWAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa60ca9d290>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True label:     4\n",
      "Classified as:  9\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAT8AAABaCAYAAADO6FH2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADa1JREFUeJzt3dtP2/Ufx/FnS0+UFijQllFgjHFYC2xsijuwuC2bTo2a\neOGFF2ritd5M/wMvTEy890ITo1miN7vReWFm3EGXERhjwDiUdUBZ2WhLoZS2UFr6u9ivVYQ5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AAv9+Pz+fbtG/EfyWLmRYGWcw0/z3qu1jQ4ZcLEn6FQcIv/z3qu1iQHR5CCPEo\nEn5CCEXKabNXCCFyRWp+QghFkvATQiiShJ8QQpEk/IQQiiThJ4RQJAk/IYQiSfgJIRRJwk8IoUgS\nfkIIRZLwE0IokoSfEEKRJPyEEIok4SeEUCQJPyGEIkn4CSEUScJPCKFIEn5CCEWS8BNCKJKEnxBC\nkST8hBCKJOEnhFAkCT8hhCJJ+AkhFEnCTwihSBJ+QghFkvATQijS/wA8d+cMoJTVdwAAAABJRU5E\nrkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa613afdb90>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True label:     4\n",
      "Classified as:  8\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAANAAAABaCAYAAADJj9jKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADA1JREFUeJzt3d1P02f/wPH3t4+U0tJa2iEWKSCiAj6MMmDIpi7LNrOD\nmSUmerC/Z1l2tmRHO97JspkYNUu2OYzOMacWhFILRaSApcAK9sE+0fZ3cIfevzv3nN77Okvl80o4\nEtvror692ut70SqlUqmEEOJv0VR6AEJUMwlICBUkICFUkICEUEECEkIFCUgIFSQgIVSQgIRQQQIS\nQgVdJe9cUZRK3v0/Zice7tipj6WsQEKoIAEJoYIEJIQKEpAQKkhAQqggAQmhggQkhAoSkBAqSEBC\nqFDRkwjVYteuXTQ0NHDo0CGam5uZn58nHA6zsLDAH3/8UenhiQqSgJ5BURQaGhro6uri3LlzHD9+\nnJGREUZGRshmsxLQDidP4f6CRqNBr9djt9tpamrCbrdjtVrp7u5mcHAQl8tV6SGKCttRK9DWgUdF\nUVAUhVKpRLFYfOr3a7VajEYju3btYs+ePVgsFkwmE52dneh0Oq5cufKyhi62qR0RUG1tLS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h2wfk8Xj44IMPsFqtKIpSPpJz584dvvvuO0KhEAsLC5Ueptihtn1AGxsb\nhEIh3G43DoeDsbExbt26xY0bNwiFQvILb6Kitn1Aa2trTExMkE6nyeVy/P7771y4cIG5uTlZeUTF\nbftt7L1797J//37q6+uxWq3l9zqIx+Pb9ojHTtz9e1V/QfFZj+W2D6gaSUCvjmc9lvIRj0KoIAEJ\noYIEJIQKEpAQKkhAQqggAQmhQkW3sYWodrICCaGCBCSEChKQECpIQEKoIAEJoYIEJIQKEpAQKkhA\nQqggAQmhggQkhAoSkBAqSEBCqCABCaGCBCSEChKQECpIQEKoIAEJoYIEJIQKEpAQKkhAQqggAQmh\nggQkhAoSkBAqSEBCqCABCaGCBCSECv8HOWscc2pA43AAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa60e091790>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True label:     6\n",
      "Classified as:  4\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAQcAAABaCAYAAAC1zJM6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAACLNJREFUeJzt3d1PUn8Ax/HPAQ4CBj6DhuhEp/lAQ2Ua5YXNrttva3ZV\n62/osvUPdONNW39BXdVWXfQ03VpNM2XpZpqKDtCpOUFAfADFp9+Fi/2s76/UVEQ/r+3cwDjf79F4\nd87xcJC2t7e3QUT0E0WyJ0BEJxPjQERCjAMRCTEORCTEOBCREONAREKMAxEJMQ5EJMQ4EJEQ40BE\nQqpkDi5JUjKHPxJn8Wr0s/B7PAvb+DPuORCREONAREKMAxEJMQ5EJMQ4EJEQ40BEQowDEQkxDkQk\nxDgQkRDjQERCjAMRCTEORCSU1A9eHZQkSZBlGRqNBjqdDhqNBrIsY3V1FZFIBKurq4jH48meJlFK\nS8k4qNVqmEwmlJSUwGazw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sFphMpsQl1QaDAUajESaT\nCUaj8ZfPRwA7fwYdHh7GxMTErsf9fj8GBwcRCoUAAAsLC/D7/bxpDJ1ZKbHn8DONRgOz2Qyz2YzC\nwsLEYUJWVhbOnz+feE6W5V9eG4vF4HK5fjk8mJmZQW9vLwKBwIHm9AP3HE4H7jmkaBwUCgV0Oh20\nWi10Ol1iD0GtVkOr1SYeF61/c3MTwWAQS0tLux6PxWIIBoMH+kTnfzEOpwPjkKJxOMkYh9OBceCt\n6YnofzAORCTEOBCREONAREKMAxEJMQ5EJMQ4EJEQ40BEQowDEQkxDkQkxDgQkRDjQERCjAMRCTEO\nRCTEOBCREONAREKMAxEJJfVOUER0cnHPgYiEGAciEmIciEiIcSAiIcaBiIQYByISYhyISIhxICIh\nxoGIhBgHIhJiHIhIiHEgIiHGgYiEGAciEmIciEiIcSAiIcaBiIQYByISYhyISIhxICIhxoGIhBgH\nIhJiHIhIiHEgIiHGgYiEGAciEvoXX90y1mUfpuIAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa60f09f850>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True label:     7\n",
      "Classified as:  3\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAANAAAABaCAYAAADJj9jKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAACIhJREFUeJzt3UtPE20fgPGrpYehrdS2hKJUKIK2iQcUxBhx4cadC9cm\nfoDnq/g1TFy6cWFcuRAjasQz0mDVVrSUnij2MJ3O0HdBaJ7H930VHX2Gtv9fQlj2LpNr7s70vgdb\nq9VqIYT4JXarByBEJ5OAhDBBAhLCBAlICBMkICFMkICEMEECEsIECUgIEyQgIUxwWPniNpvNypf/\nY3pxcUevHkuZgYQwQQISwgQJSAgTJCAhTJCAhDBBAhLCBAlICBMkICFMkICEMMHSl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Fls1kePHhAMpnE7XYTDAYZ\nGhrC5/NZPTTRIXr6dLu+vk6tVmNiYqL9PO2RkZH2XTkhfqSnZyBd16nX62xsbJDNZgkGg1y6dIlY\nLCYb7cSu9HRAhmGgqiqFQoEPHz7gdruZm5tjcnKyvXpBiO/p6YB2/sfMysoKt27dYmlpCb/fTzAY\nxO/3y14h8UM9HRBsR/Tp0yfu3btHIpHAbrejKEr7mQlCfE/PBwTb10LVapW1tTUSiQSZTAZN0+QL\nVfFDPX0XbodhGBiGwefPn1lcXCSVSqGqqgQkfsjWsnDh1167SB8cHGR4eJhSqUQul0PX9V96blwv\nrqXba8fyd/nRsZSA/gAJqHv86FjKNZAQJkhAQphg6Uc4ITqdzEBCmCABCWGCBCSECRKQECZIQEKY\nIAEJYYIEJIQJEpAQJkhAQpggAQlhggQkhAkSkBAmSEBCmCABCWGCBCSECRKQECZIQEKYIAEJYYIE\nJIQJEpAQJkhAQpggAQlhggQkhAkSkBAmSEBCmCABCWHCfwBZLKMYmcE3qAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fa6125a3f10>"
      ]
     },
     "metadata": {
      "tags": []
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#@title Choose number of misclassified digits and threshold {run: \"auto\"}\n",
    "\n",
    "NUM_MISCLASSIFIED = 10  #@param {type:\"integer\"}\n",
    "\n",
    "THRESHOLD = 0.7  #@param {type:\"slider\", min:0, max:1, step:0.1}\n",
    "\n",
    "# Find images the model misclassifies with high confidence.\n",
    "y_test_preds = model.predict(x_test)\n",
    "y_test_classes = y_test_preds.argmax(axis=1)\n",
    "\n",
    "misclassified_idxs = np.nonzero(y_test != y_test_classes)[0]\n",
    "misclassified_confidences = y_test_preds[misclassified_idxs].max(axis=1)\n",
    "\n",
    "misclassified_with_high_confidence_idxs = misclassified_idxs[\n",
    "    np.nonzero(misclassified_confidences >= THRESHOLD)[0]]\n",
    "\n",
    "print('Running SIS on {} misclassified digits. '\n",
    "      'This might take a couple minutes.\\n'.format(NUM_MISCLASSIFIED))\n",
    "\n",
    "# Randomly select some misclassificiations to run SIS.\n",
    "misclassified_idxs_to_run_sis = misclassified_with_high_confidence_idxs[\n",
    "    np.random.choice(\n",
    "        misclassified_with_high_confidence_idxs.shape[0],\n",
    "        size=NUM_MISCLASSIFIED,\n",
    "        replace=False)]\n",
    "\n",
    "# Run SIS on these images and visualize the corresponding SIS-collections.\n",
    "for idx in misclassified_idxs_to_run_sis:\n",
    "    initial_image = x_test[idx]\n",
    "\n",
    "    true_label = y_test[idx]\n",
    "    predicted_label = y_test_classes[idx]\n",
    "\n",
    "    print('True label:    ', true_label)\n",
    "    print('Classified as: ', predicted_label)\n",
    "\n",
    "    f_predicted_label = make_f_for_digit(predicted_label, model)\n",
    "    collection = sis.sis_collection(f_predicted_label, THRESHOLD, initial_image,\n",
    "                                    FULLY_MASKED_IMAGE)\n",
    "\n",
    "    plot_sis_collection(initial_image, collection, FULLY_MASKED_IMAGE)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "colab_type": "text",
    "id": "gCI352f7RPyF"
   },
   "source": [
    "These images allow us to understand ***why*** the model made these misclassifications!"
   ]
  }
 ],
 "metadata": {
  "accelerator": "TPU",
  "colab": {
   "collapsed_sections": [
    "yiRapgzcWXQw"
   ],
   "name": "sis_mnist_tutorial.ipynb",
   "version": "0.3.2"
  },
  "kernelspec": {
   "display_name": "Python 2",
   "name": "python2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
